package com.gxw.kotlint.model

import com.gxw.kotlint.api.LoginService
import com.gxw.kotlint.model.bean.params.LoginParams
import com.gxw.kotlint.model.bean.response.LoginResponse
import retrofit2.Call
import retrofit2.Retrofit
import retrofit2.adapter.guava.GuavaCallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory

/**
 * Created by GXW on 2016/4/29 0029.
 * email:603004002@qq.com
 */
class LoginModel {

     fun initLogin(loginParams: LoginParams) :Call<LoginResponse>{
        var retrofit:Retrofit = Retrofit.Builder().baseUrl("http://117.79.231.125:17080")
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(GuavaCallAdapterFactory.create())
                .build();
        var loginService:LoginService = retrofit.create(LoginService::class.java)
        return loginService.loginInfo(loginParams.loginName,loginParams.password,loginParams.deviceType)
    }

}